<?php

class Application_Model_Category extends Application_Model_DbTable_Category {

        public function getAllCategories() {
                $select = $this->_db->select()
                                ->from($this->_name);
                $result = $this->getAdapter()->fetchAll($select);
                return $result;
        }

        public function getCategories($id) {
                $select = $this->_db->select()
                                ->from($this->_name)
                                ->where('id = ?', $id);
                $result = $this->getAdapter()->fetchAll($select);
                return $result;
        }

        public function getCategoriesList() {

                $select = $this->_db->select()
                                ->from($this->_name,
                                        array('key' => 'id','value' => 'name'));
                $result = $this->getAdapter()->fetchAll($select);

                return $result;
        }

}